/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include <基本类型.h>
#include <set>
#include <filesystem>
#include <线性代数/矩阵计算.h>
#include "core/shader_color.h"



enum E_绘图API {
	E_Vulkan,
	//E_OpenGL,
	E_DirectX12,
	E_CUDA,
};



typedef enum {
	e_MS_1 = 1,
	e_MS_2 = 2,
	e_MS_4 = 4,
	e_MS_8 = 8,
	e_MS_16 = 16,
	e_MS_32 = 32,
	e_MS_64 = 64,
}E_MS次数;




enum E_数据格式 {
	e_F_RGBA,
	e_F_R32G32B32A32,
	e_F_RGB,
	e_F_R32G32,
	e_F_R32,

	e_I_R32G32B32A32,
	e_I_R32G32B32,
	e_I_R32G32,
	e_I_R32,

	e_UI_R32G32B32A32,
	e_UI_R32G32B32,
	e_UI_R32G32,
	e_UI_R32,

	e_UI8_RGBA,
	e_UI8_RGB,
	e_UI8_RG,
	e_UI8_R,
};


typedef enum : uint32 {
	e_None				= 1 << 0,
	e_VBO				= 1 << 1,
	e_UBO				= 1 << 2,
	e_TBOs				= 1 << 3,
	e_TBOd				= 1 << 4,
	e_SSBO				= 1 << 5,
	e_SSBOd				= 1 << 6,
	e_INDEX				= 1 << 7,
	e_INDIRECT			= 1 << 8,
	e_AIOMIC			= 1 << 9,
	e_DI				= 1 << 10,

	e_IMAGE				= 1 << 11,
	e_SAMPLER			= 1 << 12,
	e_IMAGE_SAMPLER     = 1 << 13,
	

	e_光追BVH			= 1 << 14,
	e_光追实例			= 1 << 15,
	e_光追底层加速结构	= 1 << 16,
	e_光追顶层加速结构	= 1 << 17,
	e_着色列表			= 1 << 18,
	e_着色端内存地址	= 1 << 19,

	e_SAMPLER_Array     = 1 << 20,
}E_板载缓存类型;




typedef enum {
	e_顶点着色		= 1 << 0,
	e_细分控制着色	= 1 << 1,
	e_细分着色		= 1 << 2,
	e_几何着色		= 1 << 3,
	e_像素着色		= 1 << 4,
	e_计算着色		= 1 << 5,
	e_光追射线生成	= 1 << 6,
	//e_命中		,
	e_最近相交		= 1 << 7,
	e_光追忽略相交	= 1 << 8,
	e_光追相交		= 1 << 9,
	e_光追最近相交	= 1 << 10,
	e_光追所有相交  = 1 << 11,
	e_光追回调   	= 1 << 12,
}E_着色阶段;


/*typedef enum : uint8 {
	e_光追阶段_光线生成,
	e_光追阶段_光线忽略,
	e_光追阶段_最近相交,
	e_光追阶段_材质回调,
}E_光追阶段ID;*/
typedef enum : uint32 {
	e_光追阶段ID_光线生成 = 0,
	e_光追阶段ID_光线忽略 = 1,
	e_光追阶段ID_最近相交 = 2,
	//e_光追阶段ID_辐射光照_最近相交 = 3,
	e_光追阶段ID_材质回调 = 3,
}E_光追阶段ID;


typedef enum {
	e_画点集,
	e_画线段,
	e_画连续线,
	e_三角形,
	e_三角形带,
	e_画扇形,

	e_画邻接线段,
	e_画邻接连续线段,
}E_绘制方式;


typedef enum {
	e_填充点,
	e_填充线,
	e_填充面,
	e_填边面,
}E_填充模式;

enum E_混合模式 {
	e_相加,
	e_相减,
	e_反向相减,
	e_最小,
	e_最大,
	e_相乘,
	e_零,
	e_源,
	e_目标,
	e_反向,
};

enum E_混合因子 {
	e_混合因子零,
	e_混合因子一,
	e_源颜色,
	e_一减源颜色,
	e_目标颜色,
	e_一减目标颜色,
	e_源透明通道,
	e_源一减源透明通道,
	e_目标透明通道,
	e_一减目标透明通道,
};

typedef enum : uint32 {
	e_光追渲染_关,
	e_光追渲染_单帧,
	e_光追渲染_序列,

	//e_模拟计算_单帧,
	e_离线计算_序列,
}E_离线渲染状态;

typedef enum {
	E_粒子物体_点,
	E_粒子物体_网格,
	E_粒子物体_网格集合,
	E_粒子物体_物理后端映射,
}E_粒子绘制类型;


typedef enum {
	e_绘图设备,
	e_计算设备,
}E_设备类型;




typedef enum : uint8 {
	e_拖放_开始,
	e_拖放_进行,
	e_拖放_结束,
}E_拖放状态;

typedef enum : uint8 {
	e_键位_任意,
	e_键位_按下,
	e_键位_放开,
	e_键位_单击,
	e_键位_双击,
	e_键位_拖放,

	e_键位_拖放开始,
	e_键位_拖放进行,
	e_键位_拖放结束,
}E_键位操作类型;




typedef struct {
	S_结构对象指针	设备;
	int32			ID;
	S_结构对象指针	pNext;
}S_协处理设备;


typedef struct {
	
}S_物理设备;

struct S_设备 {
	S_协处理设备				物理设备;
	std::vector<S_协处理设备>	逻辑设备;
};





typedef struct {
	E_绘图API		m_Type;
	S_协处理设备	m_物理设备;
	S_协处理设备	m_逻辑设备;
	
	E_MS次数		m_采样数;
	void*			m_绘图设备配置;
	
	bool			m_支持光追;
}S_设备环境;




typedef struct {
	S_结构对象指针	m_GPU属性;
	S_结构对象指针	m_渲染设备;
}S_渲染环境;





typedef struct {
	S_结构对象指针 m_像机;
	S_结构对象指针 m_矩阵;
	S_结构对象指针 m_视口;
	S_结构对象指针 m_裁剪;
	S_结构对象指针 m_GPU参数;

	S_结构对象指针 m_顶点属性;
	S_结构对象指针 m_片源属性;

}S_2D渲染参数;

/*typedef struct {
	vec3			m_深度偏移;


	S_结构对象指针	m_视图投影矩阵;
	//S_结构对象指针	m_矩阵;
	S_结构对象指针	m_视口;
	S_结构对象指针	m_裁剪;
	S_结构对象指针	m_GPU参数;



	S_板载缓存* m_间接绘制参数;

	//S_结构对象指针	m_顶点属性;
	//S_结构对象指针	m_片源属性;
	float32			m_线宽;
	

	uint32			m_实例数量;
	uint32			m_间接数量;

}S_渲染参数;*/




typedef struct {
	class S_板载缓存* m_索引;
	class S_板载缓存* m_间接;

	uint32		m_索引数量;
	uint32		m_实例数量;
	//uint32		m_间接数量;
}S_索引渲染参数;



typedef struct {
	vec2		m_方向;

	vec4* m_颜色;
	float32* m_颜色点;

	uint32		m_颜色点数量;
}S_2D渐变;



typedef struct {
	S_结构对象指针 m_Surface3D;
	S_结构对象指针 m_Scene;
}S_帧渲染层;




typedef enum : uint8 {
	e_点,
	e_线,
	e_面,
	e_线面,
	e_渲染,
	e_默认,
}E_物体显示模式;



enum E_基本材质类型 {
	e_单色材质,
};



typedef enum : uint32 {
	e_文本选择,
	e_组件移动,
	e_内置拖放数据类型_End,
}E_拖放数据类型;






typedef enum {
	e_拖放_NUL = E_拖放数据类型::e_内置拖放数据类型_End,
	e_拖放_插座,
	e_拖放_节点,
	e_节点面板移动,
	e_节点视口框选,
	e_拖放_节点子集按钮,
	e_拖放_库项加载,
	e_拖放_库项保存,
}E_自定义拖放数据类型;





typedef enum {
	e_In鼠标,
	e_In键盘,
	e_In游戏杆,
	e_In鼠标扩展1,
	e_In鼠标扩展2,
	e_In键盘扩展1,
	e_In键盘扩展2,
}E_输入设备类型预设;

typedef enum {
	e_鼠标左键,
	e_鼠标右键,
	e_鼠标中键,

	e_鼠标键Ex0,
	e_鼠标键Ex1,
	e_鼠标键Ex2,
	e_鼠标键Ex3,
	e_鼠标键Ex4,
	e_鼠标键Ex5,
	e_鼠标键Ex6,
}E_鼠标按钮;



typedef enum {
	e_KCapsLk = 0,
	e_KShift = 1,
	e_KNum = 2,
}E_控制键;


typedef struct {
	int32    lX;
	int32    lY;
	int32    lZ;
	uint8    rgbButtons[4];
}S_鼠标属性;


typedef struct {
	vec2		gPos;
	vec2		lPos;
	//精准步进
	vec2		abs;
	vec2		相对窗口偏移;
	float32		lZ;
	uint8		rgbButtons[4];
}S_鼠标;


typedef struct {
	uint8*	Keys;
	uint8*	Keys状态;
	uint8	lockKey[4];
}S_键盘;










typedef enum {
	E_物理体_空,
	
	E_物理体_流体 = 0b10,
	E_物理体_柔体 = 0b100,
	E_物理体_布料 = 0b1000,
	E_物理体_流入 = 0b10000,
	

	E_物理体_刚体 = 0b1001,
	E_物理体_控制 = 0b10001,
	E_物理体_静态 = 0b100001,
	E_物理体_车辆 = 0b1000001,
	
	
	E_物理体_流出,

	//E_物理体_流体填充,
}E_物理体类型;


enum E_物理碰撞几何类型 {
	E_碰撞几何_方体,
	E_碰撞几何_圆柱,
	E_碰撞几何_球体,
	E_碰撞几何_胶囊,
	E_碰撞几何_凸壳,
	E_碰撞几何_平面,
	
	E_碰撞几何_网格,
	E_碰撞几何_地形,
};

typedef enum {
	E_物理引擎_Mujoco,		//0
	E_物理引擎_Bullet,		//1
	E_物理引擎_PBF,			//2
	E_物理引擎_FleX,		//3
	E_物理引擎_PhysX,		//4
	E_物理引擎_FLIP,		//5
	
	E_物理引擎_ODE,			//6
	E_物理引擎_NewTon,		//7
	
	E_物理引擎_Chrono,		//8
	E_物理引擎_None,
}E_物理引擎;



typedef struct {
	vec3 pos;
	vec3 vec;
	vec3 force;
	int32 bodyID;
	float32 dis;
}S_物理互交参数;




typedef struct {
	S_结构对象指针	m_Buf;
	E_板载缓存类型	m_Type;
}S_2D绘制GPU参数元素;






typedef void(*fp_Operator)(S_结构对象指针 ops);
typedef struct {
	S_结构对象指针	m_Obj;
	fp_Operator		m_Func;
}S_Operator;
inline S_Operator* f_alloc_Ops(fp_Operator func, S_结构对象指针 执行函数参数) {
	S_Operator* ops = (S_Operator*)malloc(sizeof(S_Operator));
	ops->m_Func = func;
	ops->m_Obj = 执行函数参数;
	return ops;
}
inline void f_free_Ops(S_Operator* ops) {
	free(ops);
}

/*inline S_Operator f_alloc_Ops(fp_Operator func, S_结构对象指针 obj) {
	S_Operator ops;
	ops.m_Func = func;
	ops.m_Obj = obj;
	return ops;
}*/



typedef struct {
	S_结构对象指针	m_Obj;
	int8			m_Min;
	int8			m_Max;
}S_PropValue8;

typedef struct {
	S_结构对象指针	m_Obj;
	uint8			m_Min;
	uint8			m_Max;
}S_PropValue8u;

typedef struct {
	S_结构对象指针	m_Obj;
	int16			m_Min;
	int16			m_Max;
}S_PropValue16;

typedef struct {
	S_结构对象指针	m_Obj;
	uint16			m_Min;
	uint16			m_Max;
}S_PropValue16u;

typedef struct {
	S_结构对象指针	m_Obj;
	int32			m_Min;
	int32			m_Max;
}S_PropValue32;

typedef struct {
	S_结构对象指针	m_Obj;
	uint32			m_Min;
	uint32			m_Max;
}S_PropValue32u;

typedef struct {
	S_结构对象指针	m_Obj;
	float32			m_Min;
	float32			m_Max;
}S_PropValueF32;

typedef struct {
	std::string*	m_ICO;
	std::wstring*	m_Names;
	int32*			m_当前选项;
	uint8			m_展开;
}S_PropValueEnum;

struct S_标题和图标 {
	std::wstring m_标题;
	std::string m_图标;
};


#define DEF_alloc_属性数据(obj, type, min, max) 	\
	type* obj = (type*)malloc(sizeof(type));		\
	{												\
		obj->m_Min = min;							\
		obj->m_Max = max;							\
	}												\


struct S_板载缓存;
typedef struct {
	struct S_板载缓存* m_Buf;
	S_GPU偏移大小      m_Mem;
	void*              m_Acc;
	void*              m_As;
}S_GPU内存块索引;



typedef void(*fp_PropUpdate)(struct S_Props& prop);
typedef struct {
	std::set<struct C_Widget*>* m_LinkWidget;
	struct C_Widget*	m_部件;
	fp_PropUpdate		m_Update;		//外部创建 UI内部调用
	fp_PropUpdate		m_Set;			//UI内部创建 外部调用
	S_结构对象指针		m_关键帧;
}S_Props_UI;


typedef struct S_Props {
	E_值类型		m_Type;
	S_结构对象指针	m_Value;
	
	std::wstring	m_Name;

	S_Props_UI*		m_UI;
	S_结构对象指针	m_关键帧;
	S_GPU内存块索引 m_GPU缓存[2];
	uint32			m_值元素个数;
	uint8			m_私有;			//只有创建它的地方释放
	uint8			m_值映射类型;
}S_Props;

#define DEF_alloc_Props_UI_Ptr(prop) {((prop).m_UI) = (S_Props_UI*)malloc(sizeof(S_Props_UI)); *((prop).m_UI) = {nullptr, nullptr, nullptr, nullptr, nullptr};}
//#define DEF_alloc_Props_UI_Ptr(prop) ((prop).m_UI) = {nullptr, nullptr, nullptr};
#define DEF_release_Props_UI_Ptr(prop) free((prop).m_UI)
//#define DEF_release_Props_UI_Ptr(prop) 


inline S_Props f_alloc_OpsProp(fp_Operator func, S_结构对象指针 obj) {
	S_Operator* ops = f_alloc_Ops(func, obj);
	S_Props prop = { E_值类型::e_Type_Operator, (S_结构对象指针)ops, L"", nullptr, nullptr, {nullptr}, 0, false, 0};
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}
//使用 f_alloc_Ops 创建"S_Operator" 对象和名称传入到参数
/*inline S_Props f_alloc_OpsProp(S_Operator* ops, std::wstring name) {
	S_Props prop = { E_值类型::e_Type_Operator, (S_结构对象指针)ops, name, nullptr, 1, false };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}*/
Inline S_Props f_alloc_OpsProp(fp_Operator func, S_结构对象指针 obj, std::wstring name) {
	S_Operator* ops = f_alloc_Ops(func, obj);
	S_Props prop = { E_值类型::e_Type_Operator, (S_结构对象指针)ops, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}


inline S_Props f_alloc_NoneProp() {
	S_Props prop = { E_值类型::e_Type_None, nullptr, L"", {}, nullptr, {nullptr}, 0, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

inline S_Props f_alloc_BoolProp(bool* value, std::wstring name) {
	if (value == nullptr) value = (bool*)malloc(sizeof(bool));
	S_Props prop = { E_值类型::e_Type_Bool, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

inline S_Props f_alloc_I8Prop(int8* value, std::wstring name, int8 min = -127, int8 max = 127) {
	if (value == nullptr) value = (int8*)malloc(sizeof(int8));
	S_Props prop = { E_值类型::e_Type_I8, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

inline S_Props f_alloc_UI8Prop(uint8* value, std::wstring name, uint8 min = 0, uint8 max = 255) {
	if (value == nullptr) value = (uint8*)malloc(sizeof(uint8));
	S_Props prop = { E_值类型::e_Type_UI8, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

inline S_Props f_alloc_I32Prop(int32* value, std::wstring name, int32 min = 0x0fffffff, int32 max = 0xffffffff) {
	if (value == nullptr) value = (int32*)malloc(sizeof(int32));
	S_Props prop = { E_值类型::e_Type_I32, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}
inline S_Props f_alloc_UI32Prop(uint32* value, std::wstring name, uint32 min = 0, uint32 max = 0xfffffff) {
	if (value == nullptr) value = (uint32*)malloc(sizeof(uint32));
	S_Props prop = { E_值类型::e_Type_UI32, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}
inline S_Props f_alloc_UI64Prop(uint64* value, std::wstring name, uint64 min = 0, uint64 max = 0xfffffffffffffff) {
	//DEF_alloc_属性数据(obj, S_PropValue32u, min, max);
	S_Props prop = { E_值类型::e_Type_UI64, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

inline S_Props f_alloc_F32Prop(float32* value, std::wstring name, float32 min = -3.4E38, float32 max = +3.4E38) {
	if (value == nullptr) value = (float32*)malloc(sizeof(float32));
	S_Props prop = { E_值类型::e_Type_F32, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

Inline S_Props f_alloc_Vec2Prop(vec2* value, std::wstring name, float32 min = -3.4E38, float32 max = +3.4E38) {
	if (value == nullptr) value = (vec2*)malloc(sizeof(vec2));
	S_Props prop = { E_值类型::e_Type_Vec2, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 2, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}
Inline S_Props f_alloc_iVec2Prop(ivec2* value, std::wstring name, int32 min = 0xffffffff, int32 max = 0x0fffffff) {
	if (value == nullptr) value = (ivec2*)malloc(sizeof(ivec2));
	S_Props prop = { E_值类型::e_Type_iVec2, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 2, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}
Inline S_Props f_alloc_uVec2Prop(uvec2* value, std::wstring name, uint32 min = 0, uint32 max = 0xffffffff) {
	if (value == nullptr) value = (uvec2*)malloc(sizeof(uvec2));
	S_Props prop = { E_值类型::e_Type_uVec2, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 2, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}


inline S_Props f_alloc_Vec3Prop(vec3* value, std::wstring name, float32 min = -3.4E38, float32 max = +3.4E38) {
	if (value == nullptr) value = (vec3*)malloc(sizeof(vec3));
	S_Props prop = { E_值类型::e_Type_Vec3, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 3, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}
inline S_Props f_alloc_RgbaProp(S_RGBA8UI* value, std::wstring name, float32 min = -3.4E38, float32 max = +3.4E38) {
	if (value == nullptr) value = (S_RGBA8UI*)malloc(sizeof(S_RGBA8UI));
	S_Props prop = { E_值类型::e_Type_RGBA8, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 4, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}

inline S_Props f_alloc_EnumProp(int32* value, const std::vector<S_标题和图标>& icos, std::wstring name, uint8 默认选项 = 0, fp_PropUpdate fn_update = nullptr, bool 是否展开 = true) {
	S_PropValueEnum* e = (S_PropValueEnum*)malloc(sizeof(S_PropValueEnum));

	if (value == nullptr) {
		value = (int32*)malloc(sizeof(int32));
		(*value) = 0;
	}
	
	e->m_当前选项 = value;
	(*e->m_当前选项) = 默认选项;
	e->m_展开 = 是否展开;
	

	uint32 num = icos.size();
	e->m_ICO = new std::string[num];
	e->m_Names = new std::wstring[num];
	for (uint32 i = 0; i < num; ++i) {
		e->m_Names[i] = icos[i].m_标题;
		e->m_ICO[i] = icos[i].m_图标;
	}

	S_Props prop = { E_值类型::e_Type_Enum, (S_结构对象指针)e, name, {}, nullptr, {nullptr}, num, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	prop.m_UI->m_Update = fn_update;
	return prop;
}

inline S_Props f_alloc_StrProp(std::wstring* value, std::wstring name, fp_PropUpdate fn_update = nullptr) {
	if (value == nullptr) value = new std::wstring;
	S_Props prop = { E_值类型::e_Type_Str, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	prop.m_UI->m_Update = fn_update;
	return prop;
}
Inline std::wstring& f_prop_Str(S_Props& prop) {
	return *((std::wstring*)prop.m_Value);
}

inline S_Props f_alloc_LineStrProp(std::wstring* value, std::wstring name, fp_PropUpdate fn_update = nullptr) {
	if (value == nullptr) value = new std::wstring;
	S_Props prop = { E_值类型::e_Type_LineText, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	prop.m_UI->m_Update = fn_update;
	return prop;
}
Inline std::wstring& f_prop_LineStr(S_Props& prop) {
	return *((std::wstring*)prop.m_Value);
}

inline S_Props f_alloc_PathProp(std::filesystem::path* value, std::wstring name) {
	if (value == nullptr) value = new std::filesystem::path();
	S_Props prop = { E_值类型::e_Type_路径, (S_结构对象指针)value, name, {}, nullptr, {nullptr}, 1, false, 0 };
	DEF_alloc_Props_UI_Ptr(prop);
	return prop;
}




Inline vec3& f_prop_Vec3(S_Props& prop) {
	return *((vec3*)prop.m_Value);
}
Inline ivec2& f_prop_iVec2(S_Props& prop) {
	return *((ivec2*)prop.m_Value);
}
Inline uvec2& f_prop_uVec2(S_Props& prop) {
	return *((uvec2*)prop.m_Value);
}
Inline S_RGBA8UI& f_prop_Rgba8UI(S_Props& prop) {
	return *((S_RGBA8UI*)prop.m_Value);
}

Inline std::filesystem::path& f_prop_Path(S_Props& prop) {
	return *((std::filesystem::path*)prop.m_Value);
}


template<typename T>
inline void f_Prop_setValue(S_Props& prop, T value) {
	*((T*)prop.m_Value) = value;
	if(prop.m_UI->m_Update) prop.m_UI->m_Update(prop);
}










